package com.groupdocs.viewer.views;

import com.groupdocs.viewer.config.ServiceConfiguration;
import com.groupdocs.viewer.resources.ViewerResource;
import com.yammer.dropwizard.views.View;

import javax.servlet.http.HttpServletRequest;
import java.nio.charset.Charset;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;

/**
 *
 * @author Alex Bobkov
 */
public class ViewerView extends View{
    private String headerElems;
    private String viewerScript;
    private String renderingMode;
    
    public ViewerView(String headerElems, String viewerScript, String renderingMode){
        super("viewer.ftl", Charset.forName("UTF-8"));
        this.headerElems = headerElems;
        this.viewerScript = viewerScript;
        this.renderingMode = renderingMode;
    }

    public String getHeaderElems() {
        return headerElems;
    }

    public void setHeaderElems(String headerElems) {
        this.headerElems = headerElems;
    }

    public String getViewerScript() {
        return viewerScript;
    }

    public void setViewerScript(String viewerScript) {
        this.viewerScript = viewerScript;
    }

    public String getRenderingMode() {
        return renderingMode;
    }

    public String getOtherRenderingMode() {
        return renderingMode.equals(ViewerResource.RENDERING_MODE_HTML)
                ? ViewerResource.RENDERING_MODE_IMAGE
                : ViewerResource.RENDERING_MODE_HTML;
    }
}
